//
//  TYSearchBarAppearance.m
//  TYUIKit
//
//  Created by TuyaInc on 2019/2/11.
//

#import "TYSearchBarAppearance.h"

#import "TYUIKit.h"
//#import "TYTheme.h"
@implementation TYSearchBarAppearance

+ (instancetype)appearance {
    static TYSearchBarAppearance *instance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [self new];
    });
    return instance;
}

- (instancetype)init {
    if (self = [super init]) {
        _translucent = YES;
        _separatorHeight = 0.5;
//        _separatorColor = TYTheme.theme.app_bg_color.N7;
        _searchFieldCorner = -1;
        
//        _backgroundColor = TYTheme.theme.app_bg_color;
        _searchFieldBackgroundColor =
//        TYTheme.theme.app_bg_color.ty_isDarkcolor.boolValue
//        ? [UIColor ty_colorWithHexString:@"#232323"] :
        [UIColor ty_colorWithHexString:@"#f8f8f8"];
        
//        UIColor *color = TYTheme.theme.app_bg_color.N5;
//        _cancelButtonNormalColor = color;
//        _cancelButtonDisableColor = [color colorWithAlphaComponent:0.4];
        
        NSBundle *appBundle = [NSBundle bundleForClass:[UIApplication class]];
        NSString *str = [appBundle localizedStringForKey:@"Search" value:@"Search" table:nil];
        _placeholder = str ? : @"Search";
        
        _searchAccessibilityIdentifier = @"search";
        _cancelAccessibilityIdentifier = @"search_cancel";
    }
    return self;
}

@end
